﻿<?php
/*
 * 用户注册
 * 1、得到用户的基本资料
 * 2、添加到user_master
 * 3、添加user_info
 */
require_once '../init.php';
define('TEMPLATE_PATH', WANYA_ROOT . '/m/view/');

$User_Info_Model = new User_Info_Model();
$User_Master_Model = new User_Master_Model();

$masterId = $User_Master_Model->addUserMaster();


$userData = array();

$userData["openid"] = $_POST["openid"];
$userData["family_id"]= $masterId;
$userData["tel"]=$_POST["tel"];
$userData["sex"] = $_POST["sex"];
$userData["nickname"] = $_POST['nickname'];
$birthday=null;
$school_name=null;
$identify_label	="";
$userData["head_img_url"]=$_POST["head_img_url"];
$userData["is_main_account"]= 0;
$userIndex = $User_Info_Model->addUserInfo($userData);

include View::getView('user/addChild');
View::output();
?>